package org.example.completed.controller;

import org.example.completed.domain.Pet;
import org.example.completed.service.PetService;
import org.example.completed.utils.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class PetController {
    private final PetService petService;

    @Autowired
    public PetController(PetService petService) {
        this.petService = petService;
    }

    // 获取所有宠物
    @GetMapping("/getAllPets")
    public ApiResponse<List<Pet>> getAllPets() {
        return ApiResponse.success(petService.getAllPets(), "获取成功");
    }
}
